home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
edit
/
tde40.zip
/
global.h
< prev
next >
Wrap
Text File
|
1994-06-05
|
30KB
|
439 lines
/******************* start of original comments ********************/
/*
* Written by Douglas Thomson (1989/1990)
*
* This source code is released into the public domain.
*/
/********************* end of original comments ********************/
/*
* New editor name: TDE, the Thomson-Davis Editor.
* Author: Frank Davis
* Date: June 5, 1991
*
* This modification of Douglas Thomson's code is released into the
* public domain, Frank Davis. You may distribute it freely.
*
* See "tdestr.h" for a description of these variables. C requires global
* variables to be declared "extern" in all modules except one. This file
* is included in ed.c and it should not be included in any other module.
*/
BUFFERS g_buff;
displays g_display;
status_infos g_status;
boyer_moore_type bm;
boyer_moore_type sas_bm;
CEH ceh;
SORT sort;
DIFF diff;
MACRO_STACK macro_stack[MAX_KEYS]; /* small, simple stack for calls */
REGX_INFO regx;
REGX_INFO sas_regx;
NFA_TYPE nfa;
NFA_TYPE sas_nfa;
#if defined( __UNIX__ )
chtype tde_color_table[128];
#endif
/*
* those who use special accented characters as part of normal character set
* in text do not particularly care for a straight ASCII sort sequence.
*
* this modified ASCII sorting sequence for special accent characters is
* useful with Enlish, Esperanto, and French.
*/
SORT_ORDER sort_order = {
/* ignore case */
{ '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07',
'\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f',
'\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17',
'\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f',
' ', '!', '\"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',',
'-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
':', ';', '<', '=', '>', '?',
'@', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '[',
'\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
'x', 'y', 'z', '{', '|', '}', '~', '', 'c', 'u', 'e', 'a', 'a', 'a',
'a', 'c', 'e', 'e', 'e', 'i', 'i', 'i', 'a', 'a', 'e', 'a', 'a', 'o',
'o', 'o', 'u', 'u', 'y', 'o', 'u', '¢', '£', '¥', '₧', 'ƒ', 'a', 'i',
'o', 'u', 'n', 'n', 'ª', 'º', '¿', '⌐', '¬', '½', '¼', '¡', '«', '»',
'░', '▒', '▓', '│', '┤', '╡', '╢', '╖', '╕', '╣', '║', '╗', '╝', '╜',
'╛', '┐', '└', '┴', '┬', '├', '─', '┼', '╞', '╟', '╚', '╔', '╩', '╦',
'╠', '═', '╬', '╧', '╨', '╤', '╥', '╙', '╘', '╒', '╓', '╫', '╪', '┘',
'┌', '█', '▄', '▌', '▐', '▀', 'α', 'ß', 'Γ', 'π', 'Σ', 'σ', 'µ', 'τ',
'Φ', 'Θ', 'Ω', 'δ', '∞', 'φ', 'ε', '∩', '≡', '±', '≥', '≤', '⌠', '⌡',
'÷', '≈', '°', '∙', '·', '√', 'ⁿ', '²', '■', ' ' },
/* match case */
{ '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07',
'\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f',
'\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17',
'\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f',
' ', '!', '\"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',',
'-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
':', ';', '<', '=', '>', '?',
'@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[',
'\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
'x', 'y', 'z', '{', '|', '}', '~', '', 'C', 'u', 'e', 'a', 'a', 'a',
'a', 'c', 'e', 'e', 'e', 'i', 'i', 'i', 'A', 'A', 'E', 'a', 'A', 'o',
'o', 'o', 'u', 'u', 'y', 'O', 'U', '¢', '£', '¥', '₧', 'ƒ', 'a', 'i',
'o', 'u', 'n', 'N', 'ª', 'º', '¿', '⌐', '¬', '½', '¼', '¡', '«', '»',
'░', '▒', '▓', '│', '┤', '╡', '╢', '╖', '╕', '╣', '║', '╗', '╝', '╜',
'╛', '┐', '└', '┴', '┬', '├', '─', '┼', '╞', '╟', '╚', '╔', '╩', '╦',
'╠', '═', '╬', '╧', '╨', '╤', '╥', '╙', '╘', '╒', '╓', '╫', '╪', '┘',
'┌', '█', '▄', '▌', '▐', '▀', 'α', 'ß', 'Γ', 'π', 'Σ', 'σ', 'µ', 'τ',
'Φ', 'Θ', 'Ω', 'δ', '∞', 'φ', 'ε', '∩', '≡', '±', '≥', '≤', '⌠', '⌡',
'÷', '≈', '°', '∙', '·', '√', 'ⁿ', '²', '■', ' ' },
};
mode_infos mode = {
"$ modes", /* signature for mode structure, 8 chars */
0, /* initial color scheme */
FALSE, /* sync mode? */
TRUE, /* sync semaphore must be TRUE - DO NOT CHANGE */
FALSE, /* macro recording mode must be FALSE - DO NOT CHANGE */
TRUE, /* insert mode */
TRUE, /* indent mode */
8, /* tab size */
8, /* tab size */
TRUE, /* default smart tab mode */
FALSE, /* inflate tabs? */
IGNORE, /* sort case */
FALSE, /* enhanced keyboard flag - set in console.c */
SMALL_INS, /* default cursor size == small insert */
EOF_TEXT, /* eof message -- ** defined in letters.h ** */
FALSE, /* default FALSE = do not write ^Z at end of file */
NATIVE, /* default write <cr><lf> at eol */
TRUE, /* default remove trailing space on edited lines */
FALSE, /* default show eol character is off */
NO_WRAP, /* default word wrap mode is off */
0, /* default left margin - add 1 to margins for display */
2, /* default paragraph begin */
71, /* default right margin */
FALSE, /* default justify right margin */
FALSE, /* format paragraph/text semaphore - DO NOT CHANGE */
UNDO_STACK_LEN, /* number lines in undo buffer */
FALSE, /* default backup mode */
TRUE, /* default ruler mode */
MM_DD_YY, /* default date style */
_12_HOUR /* default time style */
};
/*
* Default color settings. Incidentally, I'm color blind (mild red-green) and
* the default colors look fine to me, Frank.
*/
TDE_COLORS colour = {
"$colors",
{ { HERC_REVERSE, HERC_NORMAL, HERC_UNDER, HERC_REVERSE, HERC_REVERSE,
HERC_HIGH, HERC_NORMAL, HERC_NORMAL, HERC_HIGH, HERC_HIGH, HERC_HIGH,
HERC_REVERSE, HERC_REVERSE, HERC_NORMAL },
{ COLOR_HEAD, COLOR_TEXT, COLOR_DIRTY, COLOR_MODE, COLOR_BLOCK,
COLOR_MESSAGE, COLOR_HELP, COLOR_DIAG, COLOR_EOF, COLOR_CURL, COLOR_RULER,
COLOR_POINTER, COLOR_TEXT, COLOR_OVRS } }
};
/*
* do_it is an array of pointers to functions that return int with an argument
* that is a pointer to a window. Is that right???
*/
int (* (do_it[NUM_FUNCS]))( TDE_WIN * ) = {
insert_overwrite, /* regular text keys 0 */
get_help, /* Help 1 */
insert_newline, /* Rturn 2 */
next_line, /* NextLine 3 */
beg_next_line, /* BegNextLine 4 */
move_down, /* LineDown 5 */
move_up, /* LineUp 6 */
move_right, /* CharRight 7 */
move_left, /* CharLeft 8 */
pan_right, /* PanRight 9 */
pan_left, /* PanLeft 10 */
word_right, /* WordRight 11 */
word_left, /* WordLeft 12 */
page_down, /* ScreenDown 13 */
page_up,